For my final visualization product I used ggplot and plotly (ggplotly) to create an interactive visualization of vessel noise propagation model results.

First, load the required packages. Raster and sf (simple features) packages are used to handle the spatial data.

#load required packages
library(sf)
library(raster)
library(ggplot2)
library(plotly)

Prepare data. Set projections, crop layers to extent of raster.

#data preperation

#state outline shapefile
states<-st_read("/Users/swricci/Documents/gis711_database/US/states_48.shp")
states_reproj<-st_transform(states,32617)

#Florida Keys National Marine Sanctuary boundaries
fknms_zones<-st_read("/Users/swricci/Documents/gis714_geocomp/dBSea_results/FKNMS_marine_zones.shp")
fknms_reproj<-st_transform(fknms_zones,32617)

#Noise propagation model results
boatSPL<-raster("passenger_captblinky_vislevelsSPL.asc")
crs(boatSPL)<-CRS("+init=epsg:32617")
boatSPL_proj<-projectRaster(boatSPL,crs=CRS("+init=epsg:4326"))

#get data ready to plot - crop to extent of study area.
studyarea_proj<-extent(boatSPL)

fknms_crop<-st_crop(fknms_reproj,studyarea_proj)
fknms<-st_transform(fknms_crop,4326)

states_crop<-st_crop(states_reproj,studyarea_proj)
fl.keys<-st_transform(states_crop,4326)

boat_df<-as.data.frame(boatSPL_proj,xy=T)
colnames(boat_df)<-c("x","y","SPL")

baseplot comparison:

plot(boatSPL_proj)
plot(st_geometry(fknms_zones),add=T)
plot(st_geometry(states),add=T)

Final ggplotly object. The plot is built with three data layers: raster with sound levels, the state shapefile and the FKNMS zones shapefile.

SPL.map<-ggplot()+
  geom_raster(data=boat_df, aes(x=x,y=y,fill = SPL,text=paste('SPL (dB):', round(SPL,2))))+
  scale_fill_viridis_c(option = "magma")+
  geom_sf(data=fknms, aes(text=Name),color = "white",fill="gray",alpha=0.6)+
  geom_sf(data=fl.keys, color = "black", fill="white")+
  #coord_sf()+
  theme_dark()+
  theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank())+
  labs(
    title = "Vessel noise propagation in FKNMS",
    y = "Latitude",
    x = "Longitude"
  )

ggplotly(SPL.map, tooltip = "text")